<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\BookarticleSerach */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Book Articles';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="book-article-index">
    <p><h1><?= $book['title'].'-'.Html::encode($this->title) ?></h1>
    <a href="<?= \yii\helpers\Url::toRoute(['book/zhua', 'id' => $book['id']]) ?>"><button type="button" class="btn btn-danger">更新最新缓存</button></a></p>
    <?php // echo $this->render('_search', ['model' => $searchModel]);
    ?>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            'title',
            [
                'label'=>'操作',
                'format'=>'raw',
                'value' => function($data){
                    $url = 'bookarticle/'.$data->id;
                    $title = $data->title;
                    return Html::a('观看', $url, ['title' => '审核']);
                }
            ],
            'create_time:datetime',




        ],
    ]); ?>
</div>

